import React from 'react';
import {connect} from 'react-redux'
import {certifacteAction}  from '../../store/action'

 class Nav2 extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      
    }
  };
  jiaClick = ()=> {
    console.log(2222);
    console.log(this.props.certifacteAction);
    
    this.props.certifacteAction(
      this.props.age
    )
  }
  render() {
  return (<div>{this.props.age}
    <button onClick={this.jiaClick}>+1</button>
  </div>)
  }
}

export default connect(state => ({ age:state.age }), {
  certifacteAction
})(Nav2);